<?php
$this->Paginator->options(array(
    'update' => '#content-outer',
    'evalScripts' => false
));

if(isset($this->request->data) && !empty($this->request->data)){
    $this->Paginator->options(array('url' => $this->request->data['CashierSell']));
}
$pageOption = $this->Paginator->params();
$sN = "CashierSell";
?>
<div id="content">
    <div id="page-heading">
        <h1>Selling Report of <?php echo $cashier['Cashier']['name'] ?> <?php echo $this->Html->link('Back',array('action'=>'index'),array('class'=>'button')) ?></h1> 
    </div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <?php echo $this->Html->image('../images/shared/side_shadowleft.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
            </th>
            <th class="topleft"></th>
            <td id="tbl-border-top">&nbsp;</td>
            <th class="topright"></th>
            <th rowspan="3" class="sized">
                <?php echo $this->Html->image('../images/shared/side_shadowright.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
            </th>
	</tr>
	<tr>
            <td id="tbl-border-left"></td>
            <td>
                <style type="text/css">
                    #search-bar{
                        margin-left: 20px;
                    }
                </style>
                <div id="content-table-inner">
                    <?php //echo $this->Session->flash();?>
                    <div id="search-bar">
                        <?php //echo $this->Html->script('admin/jquery.placeholder');  ?>
                        <?php //echo $this->Html->script('admin/jquery.placeholder');  ?>
                        <script type="text/javascript">
                            
                        function export_order(type){
                            if(type=="pdf"){
                                url = "<?php echo $this->Html->url(array('controller'=>'cashiers','action'=>'print_report2',$cashier_id,'mypdf'=>true)) ?>";
                                window.location=url;
                            }else if(type=="xls"){
                                url = "<?php echo $this->Html->url(array('controller'=>'cashiers','action'=>'export_xls',$cashier_id,'admin'=>true)) ?>/";
                                window.location=url;
                            }
                            return false;
                        }
                    </script>
                        <div style="display: inline-block; width: 200px; text-align: right;float: right;">
                            <a class="button" href="#" onclick="return export_order('pdf');">Export Pdf</a>
                            <a class="button" href="#" onclick="return export_order('xls');">Export Xls</a>
                        </div>
                    </div>
                    <div id="table-content">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
                            <tr>
                                <th class="table-header-repeat line-left">
                                    Code
                                </th>
                                <th class="table-header-repeat line-left">
                                    Type
                                </th>
                                <th class="table-header-repeat line-left">
                                    Amount
                                </th>
                                <th class="table-header-repeat line-left">
                                    Sell Time
                                </th>
                            </tr>
                            <?php 
                                $alt = 0;
                                foreach($values as $value): 
                                    $alt_row = $alt % 2;
                                    $alt_rows = ($alt_row == 1)? 'alternate-row': '';
                            ?>
                            <tr class="<?php echo $alt_rows; ?>">
                                <td>
                                    <?php 
                                    echo $value[$sN]['code'];
                                    ?>
                                </td>
                                <td>
                                    <?php echo ucfirst($value[$sN]['type']); ?>
                                </td>
                                <td>
                                    <?php echo $value[$sN]['amount']; ?>
                                </td>
                                <td>
                                    <?php 
                                    echo $value[$sN]['created'];
                                    ?>
                                </td>
                            </tr>
                            <?php 
                                $alt++;
                                endforeach; 
                            ?>
                        </table>
			<div class="clear"></div>
                        <? if($pageOption['pageCount'] > 1): ?>	
                        <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
                            <?php echo $this->element('pagination');?>       
                        </table> 
                        <? endif; ?>
                    </div>
                    <div class="clear"></div>
                </div>
            </td>
            <td id="tbl-border-right"></td>
        </tr>
        <tr>
            <th class="sized bottomleft"></th>
            <td id="tbl-border-bottom">&nbsp;</td>
            <th class="sized bottomright"></th>
        </tr>
    </table>
    <div class="clear">&nbsp;</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
            jQuery("#customerMenu").addClass('current');
});
</script>